const formatTime = date => {
  const year = date.getFullYear()
  const month = date.getMonth() + 1
  const day = date.getDate()
  const hour = date.getHours()
  const minute = date.getMinutes()
  const second = date.getSeconds()

  return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
}

const formatNumber = n => {
  n = n.toString()
  return n[1] ? n : `0${n}`
}
// baseurl
const baseApi = function () {
  const accountInfo = wx.getAccountInfoSync();
  const env = accountInfo.miniProgram.envVersion
  console.log('开发环境'+env)

	if (env === 'develop') {
		console.log('开发环境')
    //return 'http://localhost'
    return 'https://www.jnzqg.com';
	} else {
		console.log('生产环境')
		return 'https://www.jnzqg.com'
	}
}
module.exports = {
  formatTime,baseApi
}
